% if session("username") = "" then Response.Redirect "login.asp" end if %> <% 'Database Connection String; 'Server.MapPath = the location of the database on the server 'please change the path to the correct path on your server Set objADO = Server.CreateObject("ADODB.Connection") sDSN = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db\fsboREplus.mdb") & ";" objADO.Open sDSN 'Contact Variables; Used in contact.asp and other pages that contain the contact info. 'These variables are pulled from the table TblConfig and these values can 'be edited through the site admin control panel. Do not edit the values in this page. ' Create a recordset object to store specific table information Set objConfig = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * From TblConfig" 'Set the recordset object equal to the SQL query string objConfig.Open SQL, objADO, 1, 3 strVarCompany = objConfig("Company") strVarAddress = objConfig("CompanyAddress") strVarCity = objConfig("CompanyCity") strVarState = objConfig("CompanyState") strVarZip = objConfig("CompanyZip") strVarCountry = objConfig("CompanyCountry") strVarEmail = objConfig("CompanyEmail") strVarPhone = objConfig("CompanyPhone") strVarFax = objConfig("CompanyFax") strVarMainContact = objConfig("CompanyContact") strVarWebsite = objConfig("CompanyWebsite") strVarBGColor = objConfig("BGColor") strSlogan = objConfig("Slogan") strOfferAdvertising = objConfig("OfferAdvertising") str1000ImpressionsAdCost = objConfig("1000ImpressionsCost") str5000ImpressionsAdCost = objConfig("5000ImpressionsCost") str10000ImpressionsAdCost = objConfig("10000ImpressionsCost") str50000ImpressionsAdCost = objConfig("50000ImpressionsCost") str100000ImpressionsAdCost = objConfig("100000ImpressionsCost") strServiceType = objConfig("ServiceType") strServiceAdCost = objConfig("ServiceAdCost") strAgentList = objConfig("AgentList") strLogo = objConfig("logo") strKeywords = objConfig("Keywords") strMetaDescription = objConfig("MetaDescription") 'PAYPAL VARIABLES - See PaypalCode.doc located in the documentation folder 'These variables are pulled from the table TblConfig and these values can 'be edited through the site admin control panel. Do not edit the values in this page. 'Email address the payment should be sent to strPayPalEmail = objConfig("PayPalEmail") strAgentFeatured1MonthCost = objConfig("AgentFeatured1MonthCost") strAgentFeatured3MonthCost = objConfig("AgentFeatured3MonthCost") strAgentFeatured6MonthCost = objConfig("AgentFeatured6MonthCost") strAgentFeatured12MonthCost = objConfig("AgentFeatured12MonthCost") strAgentStandard1MonthCost = objConfig("AgentStandard1MonthCost") strAgentStandard3MonthCost = objConfig("AgentStandard3MonthCost") strAgentStandard6MonthCost = objConfig("AgentStandard6MonthCost") strAgentStandard12MonthCost = objConfig("AgentStandard12MonthCost") strUserFeatured1MonthCost = objConfig("UserFeatured1MonthCost") strUserFeatured3MonthCost = objConfig("UserFeatured3MonthCost") strUserFeatured6MonthCost = objConfig("UserFeatured6MonthCost") strUserFeatured12MonthCost = objConfig("UserFeatured12MonthCost") strUserStandard1MonthCost = objConfig("UserStandard1MonthCost") strUserStandard3MonthCost = objConfig("UserStandard3MonthCost") strUserStandard6MonthCost = objConfig("UserStandard6MonthCost") strUserStandard12MonthCost = objConfig("UserStandard12MonthCost") 'Description of the service to appear on the Featured Listing receipt strFeaturedAdDescription = "Featured Listing on " & strVarWebsite 'Description of the service to appear on the Regular Listing receipt strStandardAdDescription = "Standard Listing on " & strVarWebsite 'Description of the service to appear on the Upgrade Listing receipt strUpgradeAdDescription = "Upgrade Listing on " & strVarWebsite 'Cost you want to charge for the listing strUpgradeAdCost = objConfig("UpgradeAdCost") 'whether ads are paid or free strListingType = objConfig("ListingType") 'Page that the user should return to after making payment for featured ad; 'They should return to page step1F.asp under your domain; 'http://www.yourdomain.com/FSBO Auto Folder/step1F.asp strPayPalReturnPageFeatured = strVarWebsite + "/featuredsuccess.asp" 'Page that the user should return to after making payment for regular ad; 'They should return to page step1.asp under your domain; 'http://www.yourdomain.com/FSBO Auto Folder/step1.asp strPayPalReturnPageRegular = strVarWebsite + "/standardsuccess.asp" 'Page that the user should return to after making payment for regular ad; 'They should return to page step1.asp under your domain; 'http://www.yourdomain.com/FSBO Auto Folder/step1.asp strPayPalReturnPageUpgrade = strVarWebsite + "/upgradesuccess.asp" 'Page that the user should return to if cancelling before completing PayPal payment; 'They should return to page cancel.asp under your domain; 'http://www.yourdomain.com/FSBO Auto Folder/cancel.asp strPayPalCancel = strVarWebsite + "/cancel.asp" %> <% Sub CreateRoomCombo(iCount)%> <% End Sub Sub CreateFlooringCombo(iCount)%> <% End Sub ' Formats a given 10 digit number into a nice looking phone number ' Example: given strNumber of 8005551212 you get (800) 555-1212 Function FormatPhoneNumber(strNumber) Dim strInput ' String to hold our entered number Dim strTemp ' Temporary string to hold our working text Dim strCurrentChar ' Var for storing each character for eval. Dim I ' Looping var ' Uppercase all characters for consistency strInput = UCase(strNumber) ' To be able to handle some pretty bad formatting, strip out ' all characters except for chars A to Z and digits 0 to 9 ' before proceeding. I left in the chars for slogan ' numbers like 1-800-GET-CASH etc... For I = 1 To Len(strInput) strCurrentChar = Mid(strInput, I, 1) ' Numbers (0 to 9) If Asc("0") <= Asc(strCurrentChar) And Asc(strCurrentChar) <= Asc("9") Then strTemp = strTemp & strCurrentChar End If ' Upper Case Chars (A to Z) If Asc("A") <= Asc(strCurrentChar) And Asc(strCurrentChar) <= Asc("Z") Then strTemp = strTemp & strCurrentChar End If Next 'I ' Swap strTemp back to strInput for next set of validation strInput = strTemp strTemp = "" ' Remove leading 1 if applicable If Len(strInput) = 11 And Left(strInput, 1) = "1" Then strInput = Right(strInput, 10) End If ' Error catch to make sure strInput is proper length now that ' we've finished manipulating it. If Not Len(strInput) = 10 Then ' Handle errors. Err.Raise 1, "FormatPhoneNumber function", _ "The phone number to be formatted must be a valid 10 digit US phone number!" End If ' If an error occurred then the rest of this won't get processed. ' Build the output formatted string ' (xxx) xxx-xxxx strTemp = "(" ' "(" strTemp = strTemp & Left(strInput, 3) ' Area code strTemp = strTemp & ") " ' ") " strTemp = strTemp & Mid(strInput, 4, 3) ' Exchange strTemp = strTemp & "-" ' "-" strTemp = strTemp & Right(strInput, 4) ' 4 digit part ' Set return value FormatPhoneNumber = strTemp End Function sub openrs(rs, sql) Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = adUseServer rs.Open sql, cn, adOpenForwardOnly, adLockReadOnly, adCmdText end sub function ToHTML(strValue) if IsNull(strValue) then ToHTML = "" else ToHTML = Server.HTMLEncode(strValue) end if end function function ToURL(strValue) if IsNull(strValue) then strValue = "" ToURL = Server.URLEncode(strValue) end function function GetValueHTML(rs, strFieldName) GetValueHTML = ToHTML(GetValue(rs, strFieldName)) end function function GetValue(rs, strFieldName) on error resume next if rs is nothing then GetValue = "" elseif (not rs.EOF) and (strFieldName <> "") then res = rs(strFieldName) if isnull(res) then res = "" end if GetValue = res else GetValue = "" end if if bDebug then response.write err.Description end function function GetParam(ParamName) if Request.QueryString(ParamName).Count > 0 then Param = Request.QueryString(ParamName) elseif Request.Form(ParamName).Count > 0 then Param = Request.Form(ParamName) else Param = "" end if if Param = "" then GetParam = Empty else GetParam = Param end if end function Function ToSQL(Value, sType) Param = Value if Param = "" then ToSQL = "Null" else if sType = "Number" then ToSQL = CDbl(Param) else ToSQL = "'" & Replace(Param, "'", "''") & "'" end if end if end function function DLookUp(Table, fName, sWhere) on error resume next Res = cn.execute("select " & fName & " from " & Table & " where " & sWhere).Fields(0).Value if IsNull(Res) then Res = "" DLookUp = Res end function function getCheckBoxValue(sVal, CheckedValue, UnCheckedValue, sType) if isempty(sVal) then if UnCheckedValue = "" then getCheckBoxValue = "Null" else if sType = "Number" then getCheckBoxValue = UnCheckedValue else getCheckBoxValue = "'" & Replace(UnCheckedValue, "'", "''") & "'" end if end if else if CheckedValue = "" then getCheckBoxValue = "Null" else if sType = "Number" then getCheckBoxValue = CheckedValue else getCheckBoxValue = "'" & Replace(CheckedValue, "'", "''") & "'" end if end if end if end function function getValFromLOV(sVal, aArr) sRes = "" if (ubound(aArr) mod 2) = 1 then for i = 0 to ubound(aArr) step 2 if cstr(sVal) = cstr(aArr(i)) then sRes = aArr(i+1) next end if getValFromLOV = sRes end function function get_options(sql,is_search,is_required,selected_value) options_str="" if is_search then options_str=options_str&"" else if is_required then options_str=options_str&"" end if openrs tmprs,sql while not tmprs.EOF id=GetValue(tmprs, 0) value=GetValue(tmprs, 1) selected="" if CStr(id) = CStr(selected_value) then selected = "SELECTED" end if options_str = options_str & "" tmprs.MoveNext wend get_options = options_str end function Function ProceedError() if cn.Errors.Count > 0 then ProceedError = cn.Errors(0).Description & " (" & cn.Errors(0).Source & ")" elseif not (Err.Description = "") then ProceedError = Err.Description else ProceedError = "" end if end Function function CheckSecurity(iLevel) if Session("UserID") = "" then response.redirect("Login.asp?QueryString=" & toURL(request.serverVariables("QUERY_STRING")) & "&ret_page=" & toURL(request.serverVariables("SCRIPT_NAME"))) else if CLng(Session("UserRights")) < CLng(iLevel) then response.redirect("Login.asp?QueryString=" & toURL(request.serverVariables("QUERY_STRING")) & "&ret_page=" & toURL(request.serverVariables("SCRIPT_NAME"))) End if end function %> <% 'Database Connection String; 'Server.MapPath = the location of the database on the server 'please change the path to the correct path on your server Set objADO = Server.CreateObject("ADODB.Connection") sDSN = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db\fsboREplus.mdb") & ";" objADO.Open sDSN 'Contact Variables; Used in contact.asp and other pages that contain the contact info. 'These variables are pulled from the table TblConfig and these values can 'be edited through the site admin control panel. Do not edit the values in this page. ' Create a recordset object to store specific table information Set objConfig = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * From TblConfig" 'Set the recordset object equal to the SQL query string objConfig.Open SQL, objADO, 1, 3 strVarCompany = objConfig("Company") strVarAddress = objConfig("CompanyAddress") strVarCity = objConfig("CompanyCity") strVarState = objConfig("CompanyState") strVarZip = objConfig("CompanyZip") strVarCountry = objConfig("CompanyCountry") strVarEmail = objConfig("CompanyEmail") strVarPhone = objConfig("CompanyPhone") strVarFax = objConfig("CompanyFax") strVarMainContact = objConfig("CompanyContact") strVarWebsite = objConfig("CompanyWebsite") strVarBGColor = objConfig("BGColor") strSlogan = objConfig("Slogan") strOfferAdvertising = objConfig("OfferAdvertising") str1000ImpressionsAdCost = objConfig("1000ImpressionsCost") str5000ImpressionsAdCost = objConfig("5000ImpressionsCost") str10000ImpressionsAdCost = objConfig("10000ImpressionsCost") str50000ImpressionsAdCost = objConfig("50000ImpressionsCost") str100000ImpressionsAdCost = objConfig("100000ImpressionsCost") strServiceType = objConfig("ServiceType") strServiceAdCost = objConfig("ServiceAdCost") strAgentList = objConfig("AgentList") strLogo = objConfig("logo") strKeywords = objConfig("Keywords") strMetaDescription = objConfig("MetaDescription") 'PAYPAL VARIABLES - See PaypalCode.doc located in the documentation folder 'These variables are pulled from the table TblConfig and these values can 'be edited through the site admin control panel. Do not edit the values in this page. 'Email address the payment should be sent to strPayPalEmail = objConfig("PayPalEmail") strAgentFeatured1MonthCost = objConfig("AgentFeatured1MonthCost") strAgentFeatured3MonthCost = objConfig("AgentFeatured3MonthCost") strAgentFeatured6MonthCost = objConfig("AgentFeatured6MonthCost") strAgentFeatured12MonthCost = objConfig("AgentFeatured12MonthCost") strAgentStandard1MonthCost = objConfig("AgentStandard1MonthCost") strAgentStandard3MonthCost = objConfig("AgentStandard3MonthCost") strAgentStandard6MonthCost = objConfig("AgentStandard6MonthCost") strAgentStandard12MonthCost = objConfig("AgentStandard12MonthCost") strUserFeatured1MonthCost = objConfig("UserFeatured1MonthCost") strUserFeatured3MonthCost = objConfig("UserFeatured3MonthCost") strUserFeatured6MonthCost = objConfig("UserFeatured6MonthCost") strUserFeatured12MonthCost = objConfig("UserFeatured12MonthCost") strUserStandard1MonthCost = objConfig("UserStandard1MonthCost") strUserStandard3MonthCost = objConfig("UserStandard3MonthCost") strUserStandard6MonthCost = objConfig("UserStandard6MonthCost") strUserStandard12MonthCost = objConfig("UserStandard12MonthCost") 'Description of the service to appear on the Featured Listing receipt strFeaturedAdDescription = "Featured Listing on " & strVarWebsite 'Description of the service to appear on the Regular Listing receipt strStandardAdDescription = "Standard Listing on " & strVarWebsite 'Description of the service to appear on the Upgrade Listing receipt strUpgradeAdDescription = "Upgrade Listing on " & strVarWebsite 'Cost you want to charge for the listing strUpgradeAdCost = objConfig("UpgradeAdCost") 'whether ads are paid or free strListingType = objConfig("ListingType") 'Page that the user should return to after making payment for featured ad; 'They should return to page step1F.asp under your domain; 'http://www.yourdomain.com/FSBO Auto Folder/step1F.asp strPayPalReturnPageFeatured = strVarWebsite + "/featuredsuccess.asp" 'Page that the user should return to after making payment for regular ad; 'They should return to page step1.asp under your domain; 'http://www.yourdomain.com/FSBO Auto Folder/step1.asp strPayPalReturnPageRegular = strVarWebsite + "/standardsuccess.asp" 'Page that the user should return to after making payment for regular ad; 'They should return to page step1.asp under your domain; 'http://www.yourdomain.com/FSBO Auto Folder/step1.asp strPayPalReturnPageUpgrade = strVarWebsite + "/upgradesuccess.asp" 'Page that the user should return to if cancelling before completing PayPal payment; 'They should return to page cancel.asp under your domain; 'http://www.yourdomain.com/FSBO Auto Folder/cancel.asp strPayPalCancel = strVarWebsite + "/cancel.asp" %> <% Sub CreateRoomCombo(iCount)%> <% End Sub Sub CreateFlooringCombo(iCount)%> <% End Sub ' Formats a given 10 digit number into a nice looking phone number ' Example: given strNumber of 8005551212 you get (800) 555-1212 Function FormatPhoneNumber(strNumber) Dim strInput ' String to hold our entered number Dim strTemp ' Temporary string to hold our working text Dim strCurrentChar ' Var for storing each character for eval. Dim I ' Looping var ' Uppercase all characters for consistency strInput = UCase(strNumber) ' To be able to handle some pretty bad formatting, strip out ' all characters except for chars A to Z and digits 0 to 9 ' before proceeding. I left in the chars for slogan ' numbers like 1-800-GET-CASH etc... For I = 1 To Len(strInput) strCurrentChar = Mid(strInput, I, 1) ' Numbers (0 to 9) If Asc("0") <= Asc(strCurrentChar) And Asc(strCurrentChar) <= Asc("9") Then strTemp = strTemp & strCurrentChar End If ' Upper Case Chars (A to Z) If Asc("A") <= Asc(strCurrentChar) And Asc(strCurrentChar) <= Asc("Z") Then strTemp = strTemp & strCurrentChar End If Next 'I ' Swap strTemp back to strInput for next set of validation strInput = strTemp strTemp = "" ' Remove leading 1 if applicable If Len(strInput) = 11 And Left(strInput, 1) = "1" Then strInput = Right(strInput, 10) End If ' Error catch to make sure strInput is proper length now that ' we've finished manipulating it. If Not Len(strInput) = 10 Then ' Handle errors. Err.Raise 1, "FormatPhoneNumber function", _ "The phone number to be formatted must be a valid 10 digit US phone number!" End If ' If an error occurred then the rest of this won't get processed. ' Build the output formatted string ' (xxx) xxx-xxxx strTemp = "(" ' "(" strTemp = strTemp & Left(strInput, 3) ' Area code strTemp = strTemp & ") " ' ") " strTemp = strTemp & Mid(strInput, 4, 3) ' Exchange strTemp = strTemp & "-" ' "-" strTemp = strTemp & Right(strInput, 4) ' 4 digit part ' Set return value FormatPhoneNumber = strTemp End Function sub openrs(rs, sql) Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = adUseServer rs.Open sql, cn, adOpenForwardOnly, adLockReadOnly, adCmdText end sub function ToHTML(strValue) if IsNull(strValue) then ToHTML = "" else ToHTML = Server.HTMLEncode(strValue) end if end function function ToURL(strValue) if IsNull(strValue) then strValue = "" ToURL = Server.URLEncode(strValue) end function function GetValueHTML(rs, strFieldName) GetValueHTML = ToHTML(GetValue(rs, strFieldName)) end function function GetValue(rs, strFieldName) on error resume next if rs is nothing then GetValue = "" elseif (not rs.EOF) and (strFieldName <> "") then res = rs(strFieldName) if isnull(res) then res = "" end if GetValue = res else GetValue = "" end if if bDebug then response.write err.Description end function function GetParam(ParamName) if Request.QueryString(ParamName).Count > 0 then Param = Request.QueryString(ParamName) elseif Request.Form(ParamName).Count > 0 then Param = Request.Form(ParamName) else Param = "" end if if Param = "" then GetParam = Empty else GetParam = Param end if end function Function ToSQL(Value, sType) Param = Value if Param = "" then ToSQL = "Null" else if sType = "Number" then ToSQL = CDbl(Param) else ToSQL = "'" & Replace(Param, "'", "''") & "'" end if end if end function function DLookUp(Table, fName, sWhere) on error resume next Res = cn.execute("select " & fName & " from " & Table & " where " & sWhere).Fields(0).Value if IsNull(Res) then Res = "" DLookUp = Res end function function getCheckBoxValue(sVal, CheckedValue, UnCheckedValue, sType) if isempty(sVal) then if UnCheckedValue = "" then getCheckBoxValue = "Null" else if sType = "Number" then getCheckBoxValue = UnCheckedValue else getCheckBoxValue = "'" & Replace(UnCheckedValue, "'", "''") & "'" end if end if else if CheckedValue = "" then getCheckBoxValue = "Null" else if sType = "Number" then getCheckBoxValue = CheckedValue else getCheckBoxValue = "'" & Replace(CheckedValue, "'", "''") & "'" end if end if end if end function function getValFromLOV(sVal, aArr) sRes = "" if (ubound(aArr) mod 2) = 1 then for i = 0 to ubound(aArr) step 2 if cstr(sVal) = cstr(aArr(i)) then sRes = aArr(i+1) next end if getValFromLOV = sRes end function function get_options(sql,is_search,is_required,selected_value) options_str="" if is_search then options_str=options_str&"" else if is_required then options_str=options_str&"" end if openrs tmprs,sql while not tmprs.EOF id=GetValue(tmprs, 0) value=GetValue(tmprs, 1) selected="" if CStr(id) = CStr(selected_value) then selected = "SELECTED" end if options_str = options_str & "" tmprs.MoveNext wend get_options = options_str end function Function ProceedError() if cn.Errors.Count > 0 then ProceedError = cn.Errors(0).Description & " (" & cn.Errors(0).Source & ")" elseif not (Err.Description = "") then ProceedError = Err.Description else ProceedError = "" end if end Function function CheckSecurity(iLevel) if Session("UserID") = "" then response.redirect("Login.asp?QueryString=" & toURL(request.serverVariables("QUERY_STRING")) & "&ret_page=" & toURL(request.serverVariables("SCRIPT_NAME"))) else if CLng(Session("UserRights")) < CLng(iLevel) then response.redirect("Login.asp?QueryString=" & toURL(request.serverVariables("QUERY_STRING")) & "&ret_page=" & toURL(request.serverVariables("SCRIPT_NAME"))) End if end function %>
|
<%
'Database Connection String;
'Server.MapPath = the location of the database on the server
'please change the path to the correct path on your server
Set objADO = Server.CreateObject("ADODB.Connection")
sDSN = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db\fsboREplus.mdb") & ";"
objADO.Open sDSN
'Contact Variables; Used in contact.asp and other pages that contain the contact info.
'These variables are pulled from the table TblConfig and these values can
'be edited through the site admin control panel. Do not edit the values in this page.
' Create a recordset object to store specific table information
Set objConfig = Server.CreateObject("ADODB.Recordset")
'Establish what records you want selected for the SQL query string
SQL = "Select * From TblConfig"
'Set the recordset object equal to the SQL query string
objConfig.Open SQL, objADO, 1, 3
strVarCompany = objConfig("Company")
strVarAddress = objConfig("CompanyAddress")
strVarCity = objConfig("CompanyCity")
strVarState = objConfig("CompanyState")
strVarZip = objConfig("CompanyZip")
strVarCountry = objConfig("CompanyCountry")
strVarEmail = objConfig("CompanyEmail")
strVarPhone = objConfig("CompanyPhone")
strVarFax = objConfig("CompanyFax")
strVarMainContact = objConfig("CompanyContact")
strVarWebsite = objConfig("CompanyWebsite")
strVarBGColor = objConfig("BGColor")
strSlogan = objConfig("Slogan")
strOfferAdvertising = objConfig("OfferAdvertising")
str1000ImpressionsAdCost = objConfig("1000ImpressionsCost")
str5000ImpressionsAdCost = objConfig("5000ImpressionsCost")
str10000ImpressionsAdCost = objConfig("10000ImpressionsCost")
str50000ImpressionsAdCost = objConfig("50000ImpressionsCost")
str100000ImpressionsAdCost = objConfig("100000ImpressionsCost")
strServiceType = objConfig("ServiceType")
strServiceAdCost = objConfig("ServiceAdCost")
strAgentList = objConfig("AgentList")
strLogo = objConfig("logo")
strKeywords = objConfig("Keywords")
strMetaDescription = objConfig("MetaDescription")
'PAYPAL VARIABLES - See PaypalCode.doc located in the documentation folder
'These variables are pulled from the table TblConfig and these values can
'be edited through the site admin control panel. Do not edit the values in this page.
'Email address the payment should be sent to
strPayPalEmail = objConfig("PayPalEmail")
strAgentFeatured1MonthCost = objConfig("AgentFeatured1MonthCost")
strAgentFeatured3MonthCost = objConfig("AgentFeatured3MonthCost")
strAgentFeatured6MonthCost = objConfig("AgentFeatured6MonthCost")
strAgentFeatured12MonthCost = objConfig("AgentFeatured12MonthCost")
strAgentStandard1MonthCost = objConfig("AgentStandard1MonthCost")
strAgentStandard3MonthCost = objConfig("AgentStandard3MonthCost")
strAgentStandard6MonthCost = objConfig("AgentStandard6MonthCost")
strAgentStandard12MonthCost = objConfig("AgentStandard12MonthCost")
strUserFeatured1MonthCost = objConfig("UserFeatured1MonthCost")
strUserFeatured3MonthCost = objConfig("UserFeatured3MonthCost")
strUserFeatured6MonthCost = objConfig("UserFeatured6MonthCost")
strUserFeatured12MonthCost = objConfig("UserFeatured12MonthCost")
strUserStandard1MonthCost = objConfig("UserStandard1MonthCost")
strUserStandard3MonthCost = objConfig("UserStandard3MonthCost")
strUserStandard6MonthCost = objConfig("UserStandard6MonthCost")
strUserStandard12MonthCost = objConfig("UserStandard12MonthCost")
'Description of the service to appear on the Featured Listing receipt
strFeaturedAdDescription = "Featured Listing on " & strVarWebsite
'Description of the service to appear on the Regular Listing receipt
strStandardAdDescription = "Standard Listing on " & strVarWebsite
'Description of the service to appear on the Upgrade Listing receipt
strUpgradeAdDescription = "Upgrade Listing on " & strVarWebsite
'Cost you want to charge for the listing
strUpgradeAdCost = objConfig("UpgradeAdCost")
'whether ads are paid or free
strListingType = objConfig("ListingType")
'Page that the user should return to after making payment for featured ad;
'They should return to page step1F.asp under your domain;
'http://www.yourdomain.com/FSBO Auto Folder/step1F.asp
strPayPalReturnPageFeatured = strVarWebsite + "/featuredsuccess.asp"
'Page that the user should return to after making payment for regular ad;
'They should return to page step1.asp under your domain;
'http://www.yourdomain.com/FSBO Auto Folder/step1.asp
strPayPalReturnPageRegular = strVarWebsite + "/standardsuccess.asp"
'Page that the user should return to after making payment for regular ad;
'They should return to page step1.asp under your domain;
'http://www.yourdomain.com/FSBO Auto Folder/step1.asp
strPayPalReturnPageUpgrade = strVarWebsite + "/upgradesuccess.asp"
'Page that the user should return to if cancelling before completing PayPal payment;
'They should return to page cancel.asp under your domain;
'http://www.yourdomain.com/FSBO Auto Folder/cancel.asp
strPayPalCancel = strVarWebsite + "/cancel.asp"
%>
<%
Sub CreateRoomCombo(iCount)%>
<%
End Sub
Sub CreateFlooringCombo(iCount)%>
<%
End Sub
' Formats a given 10 digit number into a nice looking phone number
' Example: given strNumber of 8005551212 you get (800) 555-1212
Function FormatPhoneNumber(strNumber)
Dim strInput ' String to hold our entered number
Dim strTemp ' Temporary string to hold our working text
Dim strCurrentChar ' Var for storing each character for eval.
Dim I ' Looping var
' Uppercase all characters for consistency
strInput = UCase(strNumber)
' To be able to handle some pretty bad formatting, strip out
' all characters except for chars A to Z and digits 0 to 9
' before proceeding. I left in the chars for slogan
' numbers like 1-800-GET-CASH etc...
For I = 1 To Len(strInput)
strCurrentChar = Mid(strInput, I, 1)
' Numbers (0 to 9)
If Asc("0") <= Asc(strCurrentChar) And Asc(strCurrentChar) <= Asc("9") Then
strTemp = strTemp & strCurrentChar
End If
' Upper Case Chars (A to Z)
If Asc("A") <= Asc(strCurrentChar) And Asc(strCurrentChar) <= Asc("Z") Then
strTemp = strTemp & strCurrentChar
End If
Next 'I
' Swap strTemp back to strInput for next set of validation
strInput = strTemp
strTemp = ""
' Remove leading 1 if applicable
If Len(strInput) = 11 And Left(strInput, 1) = "1" Then
strInput = Right(strInput, 10)
End If
' Error catch to make sure strInput is proper length now that
' we've finished manipulating it.
If Not Len(strInput) = 10 Then
' Handle errors.
Err.Raise 1, "FormatPhoneNumber function", _
"The phone number to be formatted must be a valid 10 digit US phone number!"
End If
' If an error occurred then the rest of this won't get processed.
' Build the output formatted string
' (xxx) xxx-xxxx
strTemp = "(" ' "("
strTemp = strTemp & Left(strInput, 3) ' Area code
strTemp = strTemp & ") " ' ") "
strTemp = strTemp & Mid(strInput, 4, 3) ' Exchange
strTemp = strTemp & "-" ' "-"
strTemp = strTemp & Right(strInput, 4) ' 4 digit part
' Set return value
FormatPhoneNumber = strTemp
End Function
sub openrs(rs, sql)
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = adUseServer
rs.Open sql, cn, adOpenForwardOnly, adLockReadOnly, adCmdText
end sub
function ToHTML(strValue)
if IsNull(strValue) then
ToHTML = ""
else
ToHTML = Server.HTMLEncode(strValue)
end if
end function
function ToURL(strValue)
if IsNull(strValue) then strValue = ""
ToURL = Server.URLEncode(strValue)
end function
function GetValueHTML(rs, strFieldName)
GetValueHTML = ToHTML(GetValue(rs, strFieldName))
end function
function GetValue(rs, strFieldName)
on error resume next
if rs is nothing then
GetValue = ""
elseif (not rs.EOF) and (strFieldName <> "") then
res = rs(strFieldName)
if isnull(res) then
res = ""
end if
GetValue = res
else
GetValue = ""
end if
if bDebug then response.write err.Description
end function
function GetParam(ParamName)
if Request.QueryString(ParamName).Count > 0 then
Param = Request.QueryString(ParamName)
elseif Request.Form(ParamName).Count > 0 then
Param = Request.Form(ParamName)
else
Param = ""
end if
if Param = "" then
GetParam = Empty
else
GetParam = Param
end if
end function
Function ToSQL(Value, sType)
Param = Value
if Param = "" then
ToSQL = "Null"
else
if sType = "Number" then
ToSQL = CDbl(Param)
else
ToSQL = "'" & Replace(Param, "'", "''") & "'"
end if
end if
end function
function DLookUp(Table, fName, sWhere)
on error resume next
Res = cn.execute("select " & fName & " from " & Table & " where " & sWhere).Fields(0).Value
if IsNull(Res) then Res = ""
DLookUp = Res
end function
function getCheckBoxValue(sVal, CheckedValue, UnCheckedValue, sType)
if isempty(sVal) then
if UnCheckedValue = "" then
getCheckBoxValue = "Null"
else
if sType = "Number" then
getCheckBoxValue = UnCheckedValue
else
getCheckBoxValue = "'" & Replace(UnCheckedValue, "'", "''") & "'"
end if
end if
else
if CheckedValue = "" then
getCheckBoxValue = "Null"
else
if sType = "Number" then
getCheckBoxValue = CheckedValue
else
getCheckBoxValue = "'" & Replace(CheckedValue, "'", "''") & "'"
end if
end if
end if
end function
function getValFromLOV(sVal, aArr)
sRes = ""
if (ubound(aArr) mod 2) = 1 then
for i = 0 to ubound(aArr) step 2
if cstr(sVal) = cstr(aArr(i)) then sRes = aArr(i+1)
next
end if
getValFromLOV = sRes
end function
function get_options(sql,is_search,is_required,selected_value)
options_str=""
if is_search then
options_str=options_str&""
else
if is_required then options_str=options_str&""
end if
openrs tmprs,sql
while not tmprs.EOF
id=GetValue(tmprs, 0)
value=GetValue(tmprs, 1)
selected=""
if CStr(id) = CStr(selected_value) then
selected = "SELECTED"
end if
options_str = options_str & ""
tmprs.MoveNext
wend
get_options = options_str
end function
Function ProceedError()
if cn.Errors.Count > 0 then
ProceedError = cn.Errors(0).Description & " (" & cn.Errors(0).Source & ")"
elseif not (Err.Description = "") then
ProceedError = Err.Description
else
ProceedError = ""
end if
end Function
function CheckSecurity(iLevel)
if Session("UserID") = "" then
response.redirect("Login.asp?QueryString=" & toURL(request.serverVariables("QUERY_STRING")) & "&ret_page=" & toURL(request.serverVariables("SCRIPT_NAME")))
else
if CLng(Session("UserRights")) < CLng(iLevel) then response.redirect("Login.asp?QueryString=" & toURL(request.serverVariables("QUERY_STRING")) & "&ret_page=" & toURL(request.serverVariables("SCRIPT_NAME")))
End if
end function
%>
<%
TodayDate = Now()
TodayDate = FormatDateTime(TodayDate, VBShortDate)
Set RS=Server.CreateObject("ADODB.RecordSet")
SQL = vbNullString
SQL = SQL & "UPDATE Clients "
SQL = SQL & "SET Status='DontShow' WHERE ImpPur < ImpNow"
objADO.execute(SQL)
Set RS = Nothing
Set RS=Server.CreateObject("ADODB.RecordSet")
Query = "SELECT * FROM Clients WHERE Status='Show' AND StartDate <= #" & TodayDate & "#"
RS.Open Query, objADO, 3, 3
IF (RS.EOF) THEN
ShowBanner = "default"
%>
<%
Else
rndMax = CInt(RS.RecordCount)
RS.MoveFirst
Do While Not RS.EOF
RS.MoveNext
Loop
RS.MoveFirst
Randomize Timer
rndNumber = Int(RND * rndMax)
RS.Move rndNumber
Id = RS("AdID")
UrlTo = RS("LinkTo")
GetImg = RS("ImgUrl")
WriteSize1 = RS("SizeOf1")
WriteSize2 = RS("SizeOf2")
DisText = RS("TextUnder")
ImpNow = RS("ImpNow")
ImpNewNow = ImpNow + 1
Set RS = Nothing
Set RS=Server.CreateObject("ADODB.RecordSet")
SQL = vbNullString
SQL = SQL & "UPDATE Clients "
SQL = SQL & "SET ImpNow="&ImpNewNow&" WHERE AdID="&Id&""
objADO.execute(SQL)
Set RS = Nothing
End If
%>
|
||||||||
|
||||||||
" Set lojbFile = oUpload(psUpload) ' parse the file name lsFileName = lojbFile.FileName If Len(Trim(lsFileName)) < 1 Then Exit Function If InStrRev(lsFileName, "\") > 0 Then lsFileName = Mid(lsFileName, InStrRev(lsFileName, "\") + 1) WriteUploadedFile = lsFileName If Not InStr(lsFileName, "\") = 0 Then lsFileName = Mid(lsFileName, InStrRev(lsFileName, "\") + 1) End If ' Convert the binary data to Ascii bytBinaryData = lojbFile.BinaryData nLength = LenB(bytBinaryData) For nIndex = 1 To nLength sNewData = sNewData & Chr(AscB(MidB(bytBinaryData, nIndex, 1))) Next ' Save the file to the file system psPath = Server.MapPath(psPath) If Not Right(psPath, 1) = "\" Then psPath = psPath & "\" 'Response.Write "psPath=" & psPath & " " 'Response.Write "lsFileName=" & lsFileName & " " Set lobjFSO = Server.CreateObject("Scripting.FileSystemObject") 'If lobjFSO.FileExists(psPath & lsFileName) Then lsFileName = session("UserName") & "_" & lsFileName 'Response.Write lsFileName 'end if lobjFSO.OpenTextFile(psPath & lsFileName, 2, True).Write sNewData 'Set lobjFSO = Nothing 'Set lobjFile = Nothing End Function ' ------------------------------------------------------------------------------ ' Container of Field Properties Class clsField Public FileName Public ContentType Public Value Public FieldName Public Length Public BinaryData End Class ' ------------------------------------------------------------------------------ Class clsUpload ' ------------------------------------------------------------------------------ Private nFieldCount Private oFields() ' ------------------------------------------------------------------------------ Public Property Get Count() Count = nFieldCount End Property ' ------------------------------------------------------------------------------ Public Default Property Get Field(ByRef asFieldName) Dim lnLength Dim lnIndex lnLength = UBound(oFields) If IsNumeric(asFieldName) Then If lnLength >= asFieldName And asFieldName > -1 Then Set Field = oFields(asFieldName) Else Set Field = New clsField End If Else For lnIndex = 0 To lnLength If LCase(oFields(lnIndex).FieldName) = LCase(asFieldName) Then Set Field = oFields(lnIndex) Exit Property End If Next Set Field = New clsField End If End Property ' ------------------------------------------------------------------------------ Public Function Exists(ByRef avKeyIndex) Exists = Not IndexOf(avKeyIndex) = -1 End Function ' ------------------------------------------------------------------------------ Public Property Get ValueOf(ByRef avKeyIndex) Dim lnIndex lnIndex = IndexOf(avKeyIndex) if lnIndex = -1 Then Exit Property ValueOf = oFields(lnIndex).Value End Property ' ------------------------------------------------------------------------------ Public Property Get FileNameOf(ByRef avKeyIndex) Dim lnIndex lnIndex = IndexOf(avKeyIndex) if lnIndex = -1 Then Exit Property FileNameOf = oFields(lnIndex).FileName End Property ' ------------------------------------------------------------------------------ Public Property Get LengthOf(ByRef avKeyIndex) Dim lnIndex lnIndex = IndexOf(avKeyIndex) if lnIndex = -1 Then Exit Property LengthOf = oFields(lnIndex).LengthOf End Property ' ------------------------------------------------------------------------------ Public Property Get BinaryDataOf(ByRef avKeyIndex) Dim lnIndex lnIndex = IndexOf(avKeyIndex) if lnIndex = -1 Then Exit Property BinaryDataOf = oFields(lnIndex).BinaryData End Property ' ------------------------------------------------------------------------------ Private Function IndexOf(ByVal avKeyIndex) Dim lnIndex If IsNumeric(asFieldName) Then avKeyIndex = CLng(avKeyIndex) If nFieldCount > avKeyIndex And avKeyIndex > -1 Then IndexOf = avKeyIndex Else IndexOf = -1 End If Else For lnIndex = 0 To nFieldCount - 1 If LCase(oFields(lnIndex).FieldName) = LCase(avKeyIndex) Then IndexOf = lnIndex Exit Function End If Next IndexOf = -1 End If End Function ' ------------------------------------------------------------------------------ Public Property Get ContentTypeOf(ByRef avKeyIndex) Dim lnIndex lnIndex = IndexOf(avKeyIndex) if lnIndex = -1 Then Exit Property ContentTypeOf = oFields(lnIndex).ContentType End Property ' ------------------------------------------------------------------------------ Private Sub Class_Terminate() For lnIndex = 0 To nFieldCount - 1 Set oFields(0) = Nothing Next End Sub ' ------------------------------------------------------------------------------ Private Sub Class_Initialize() Dim lnBytes ' Bytes received from the client Dim lnByteCount ' Number of bytes received Dim lnStartPosition ' Position at which content begins Dim lnEndPosition ' Position at which content ends Dim loDic ' Contains properties of each ' specific field ' Local dictionary object(s) ' to be appended to class-scope ' dictioary object. Dim lnBoundaryBytes ' Bytes contained within the current boundary Dim lnBoundaryStart ' Position at wich the current boundary begins ' within the lnBytes binary data. Dim lnBoundaryEnd ' Position at wich the current boundary ends ' within the lnBytes binary data. Dim lnDispositionPosition Dim lsFieldName ' Name of the current field being parsed from ' Binary Data Dim lsFileName ' Name of the file within the current boundary Dim lnFileNamePosition ' Location of file name within current boundary ' Initialize Fields nFieldCount = 0 ReDim oFields(-1) ' Read the bytes (binary data) into memory lnByteCount = Request.TotalBytes lnBytes = Request.BinaryRead(lnByteCount) 'Get the lnBoundaryBytes lnStartPosition = 1 lnEndPosition = InstrB(lnStartPosition, lnBytes, CStrB(vbCr)) lnBoundaryBytes = MidB(lnBytes, lnStartPosition, lnEndPosition - lnStartPosition) lnBoundaryStart = InstrB(1, lnBytes, lnBoundaryBytes) ' Loop until the BoundaryBytes begin with "--" Do Until (lnBoundaryStart = InstrB(lnBytes, lnBoundaryBytes & CStrB("--"))) ' All data within this boundary is stored within a local dictionary ' to be appended to the class-scope dictionary. ReDim Preserve oFields(nFieldCount) nFieldCount = nFieldCount + 1 Set loField = New clsField lnDispositionPosition = InstrB(lnBoundaryStart, lnBytes, CStrB("Content-Disposition")) ' Get an object name lnStartPosition = InstrB(lnDispositionPosition, lnBytes, CStrB("name=")) + 6 lnEndPosition = InstrB(lnStartPosition, lnBytes, CStrB("""")) lsFieldName = CStrU(MidB(lnBytes, lnStartPosition, lnEndPosition - lnStartPosition)) loField.FieldName = lsFieldName ' Get the location fo the file name. lnFileNamePosition = InstrB(lnBoundaryStart, lnBytes, CStrB("filename=")) lnBoundaryEnd = InstrB(lnEndPosition, lnBytes, lnBoundaryBytes) 'Test if object is a file If Not lnFileNamePosition = 0 And lnFileNamePosition < lnBoundaryEnd Then ' Parse Filename lnStartPosition = lnFileNamePosition + 10 lnEndPosition = InstrB(lnStartPosition, lnBytes, CStrB("""")) lsFileName = CStrU(MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition)) loField.FileName = lsFileName ' Parse Content-Type lnStartPosition = InstrB(lnEndPosition,lnBytes,CStrB("Content-Type:")) + 14 lnEndPosition = InstrB(lnStartPosition,lnBytes,CStrB(vbCr)) ContentType = CStrU(MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition)) loField.ContentType = ContentType ' Parse Content lnStartPosition = lnEndPosition + 4 lnEndPosition = InstrB(lnStartPosition,lnBytes,lnBoundaryBytes)-2 Value = MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition) loField.BinaryData = Value & CStrB(vbNull) loField.Length = LenB(Value) Else ' Parse Content lnStartPosition = InstrB(lnDispositionPosition, lnBytes, CStrB(vbCr)) + 4 lnEndPosition = InstrB(lnStartPosition, lnBytes, lnBoundaryBytes) - 2 Value = CStrU(MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition)) loField.Value = Value loField.Length = Len(Value) End If Set oFields(UBound(oFields)) = loField 'Loop to next object lnBoundaryStart = InstrB(lnBoundaryStart + LenB(lnBoundaryBytes), lnBytes, lnBoundaryBytes) Set loField = Nothing Loop End Sub ' ------------------------------------------------------------------------------ Private Function CStrU(ByRef psByteString) Dim lnLength Dim lnPosition lnLength = LenB(psByteString) For lnPosition = 1 To lnLength CStrU = CStrU & Chr(AscB(MidB(psByteString, lnPosition, 1))) Next End Function ' ------------------------------------------------------------------------------ Private Function CStrB(ByRef psUnicodeString) Dim lnLength Dim lnPosition lnLength = Len(psUnicodeString) For lnPosition = 1 To lnLength CStrB = CStrB & ChrB(AscB(Mid(psUnicodeString, lnPosition, 1))) Next End Function ' ------------------------------------------------------------------------------ End Class ' ------------------------------------------------------------------------------ %> <% Function ImageResize(sImageName, iMaxWidth, iMaxHeight) Dim iMaxX, iMaxY, iNewX, iNewY, bResize Set objImage = Server.CreateObject("AspImage.Image") objImage.LoadImage sImageName objImage.ImageFormat = 1 objImage.JPEGQuality = 95 bResize = False iNewX = 0 iNewY = 0 iMaxX = objImage.MaxX iMaxY = objImage.MaxY If iMaxX > iMaxWidth Then bResize = True iPercent = iMaxWidth / iMaxX iNewX = iMaxWidth iNewY = iPercent * iMaxY If iNewY > iMaxHeight Then iPercent = iMaxHeight / iMaxY iNewX = iPercent * iMaxX iNewY = iMaxHeight End If End If If iNewY < 1 And iMaxY > iMaxHeight Then bResize = True iPercent = iMaxHeight / iMaxY iNewX = iPercent * iMaxX iNewY = iMaxHeight End If If bResize Then objImage.Resize iNewX, iNewY If UCase(Right(sImageName, 3)) = "GIF" Then sImageName = Left(sImageName, Len(sImageName) - 3) & "jpg" objImage.FileName = sImageName objImage.SaveImage End If ImageResize = sImageName Set objImage = Nothing End Function %> <% lDelete = Request("ID") strAccessLevel = session("AccessLevel") Action = request("Action") if lDelete = "" then msg = " You must select a listing to delete." end if if msg = "" then sSQL = "SELECT * FROM (REFlooring RIGHT JOIN (RERoom RIGHT JOIN (REExterior RIGHT JOIN" sSQL = sSQL & " (REAC RIGHT JOIN (((((REHeat RIGHT JOIN (REGarage RIGHT JOIN" sSQL = sSQL & " (REDriveway RIGHT JOIN REListing ON REDriveway.REDrivewayID = REListing.REDrivewayID)" sSQL = sSQL & " ON REGarage.REGarageID = REListing.REGarageID) ON REHeat.REHeatID = REListing.REHeatID)" sSQL = sSQL & " LEFT JOIN RERoof ON REListing.RERoofID = RERoof.RERoofID) LEFT JOIN" sSQL = sSQL & " RESewer ON REListing.RESewerID = RESewer.RESewerID) LEFT JOIN" sSQL = sSQL & " REStyle ON REListing.REStyleID = REStyle.REStyleID) LEFT JOIN" sSQL = sSQL & " REWater ON REListing.REWaterID = REWater.REWaterID) ON REAC.REACID = REListing.REACID)" sSQL = sSQL & " ON REExterior.REExteriorID = REListing.REExteriorID)" sSQL = sSQL & " ON (RERoom.RERoomID = REListing.REListingRoom8ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom7ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom6ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom5ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom4ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom3ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom2ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom1ID))" sSQL = sSQL & " ON (REFlooring.REFlooringID = REListing.REListingFlooring8ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring7ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring6ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring5ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring4ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring3ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring2ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring1ID))" sSQL = sSQL & " WHERE REListingID=" & lDelete Set rsRealEstate = objADO.Execute(sSQL) 'Used to dynamically display school info strStateName = rsRealEstate("REListingState") SQL = "SELECT * FROM TblStates where StateName = '" + strStateName + "'" Set rsState = Server.CreateObject("ADODB.Recordset") rsState.Open SQL, objADO, 3, 3 sSQL = "SELECT * FROM RERoom ORDER BY RERoomID" Set rsRoom = objADO.Execute(sSQL) Do While Not rsRoom.EOF n = n + 1 ReDim Preserve lRoomID(n), sRoomName(n) lRoomID(n) = rsRoom("RERoomID") sRoomName(n) = rsRoom("RERoomName") rsRoom.MoveNext Loop n = 0 sSQL = "SELECT * FROM REFlooring ORDER BY REFlooringID" Set rsFlooring = objADO.Execute(sSQL) Do While Not rsFlooring.EOF n = n + 1 ReDim Preserve lFlooringID(n), sFlooringName(n) lFlooringID(n) = rsFlooring("REFlooringID") sFlooringName(n) = rsFlooring("REFlooringName") rsFlooring.MoveNext Loop Function GetRoomName(n) For iCount = 1 to UBound(lRoomID) If n = lRoomID(iCount) Then GetRoomName = sRoomName(iCount) Exit Function End If Next End Function Function GetFlooringName(n) For iCount = 1 to UBound(lFlooringID) If n = lFlooringID(iCount) Then GetFlooringName = sFlooringName(iCount) Exit Function End If Next End Function end if %> <% strMailSubmit = request("cmdMailSubmit") strSearchId = request("cmdSearchId") strEmail = request("txtEmail") strSiteId = request("txtSiteId") 'This code only runs if the submit button is clicked if Request.Form <> "" and strSearchId <> "" then if strSiteId = "" then SiteIdmsg = "You must enter a site id to search." end if if SiteIdmsg = "" then ' Create a recordset object to store specific table information Set objSearch = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * From REListing where REListingId=" & strSiteId 'Set the recordset object equal to the SQL query string objSearch.Open SQL, objADO, 1, 3 if objSearch.EOF then SiteIdmsg = "Site Id " & strSiteId & " does not exist in our database. Please try again." else Response.Redirect "detail.asp?Id=" & strSiteId end if end if end if if Request.Form <> "" and strMailSubmit <> "" then if strEmail = "" then strMailWarning = "You must type an email address to join our mailing list." end if 'Make sure a valid email address if strEmail <> "" and (instr( strEmail, "@") = 0 or instr( strEmail, ".") = 0) then strMailWarning = " Email Address must be in the form account@server.com." end if if strMailWarning = "" then ' Create a recordset object to store specific table information Set objEmail = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * From TblEmail where (EmailAddress = '" + strEmail + "')" 'Set the recordset object equal to the SQL query string objEmail.Open SQL, objADO, 1, 3 if objEmail.EOF then objEmail.addnew objEmail("EmailAddress") = strEmail objEmail("DateAdded") = Date() objEmail.update strMailWarning =" Your email address has been sucessfully added to our mailing list." 'Mail STATING you hate to see them go and link if they want to subscribe again. ' Create a recordset object to store specific table information strSubject = strVarCompany & " Mail Subscription Request" strBody = strBody + "Your email address has been successfully added to our mailing list." &vbcrlf strBody = strBody + "Thank you for being a subscriber." & vbcrlf strBody = strBody + "To unsubscribe, use the url " & strVarWebsite & "." & vbcrlf strBody = strBody + "Again thank you for being a subscriber." Set objNewMail = Server.CreateObject("CDONTS.NewMail") objNewMail.From = strVarEmail objNewMail.To = strEmail objNewMail.Subject = strSubject objNewMail.BodyFormat = 1 'objNewMail.MailFormat = 1 objNewMail.Body = strBody objNewMail.Send() else strMailWarning = " That Email Address already joined our mailing list." end if end if end if %> |
||||||||
| |
|
|
|
|
|
|
|
|
<% if strMailWarning <> "" then %>
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |
|
|
|
|
|
|
|
|
|
|
||||||||
|
||||||||